﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Input;
using SimpleJson;

namespace MetroEventbrite.External.Eventbrite
{
    public class EBVenue
    {
        public static EBVenue Load(string json)
        {
            var result = new EBVenue();

            JsonObject jsonObj;
            try
            {

                jsonObj = (JsonObject)SimpleJson.SimpleJson.DeserializeObject(json);
            }
            catch (Exception ex)
            {
                return result;
            }
            return Load(jsonObj);
        }

        private static EBVenue Load(JsonObject jsonObj)
        {
            var result = new EBVenue();
            if (jsonObj.ContainsKey("id"))
            {
                result.VenueId = jsonObj["id"].ToString();
            }
            return result;
        }

        public string VenueId { get; set; }
    }
}
